package model;


import java.io.*;

import quicktime.streaming.Stream;

public class UMLFileHandler implements Serializable, ObjectInputValidation  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	ObjectOutputStream anOutputStream;
	ObjectInputStream anInputStream;
	String name = null;
	private ParameterImpl PI;
	
	
//	ObjectOutputStream oos = 
//		new ObjectOutputStream(anOutputStream);
//		Serializable serializableObject = 
//		oos.writeObject(serializableObject);
	
	public UMLFileHandler(String name){
		
		this.name = name;
		
	}
	
	private void readObject(java.io.ObjectInputStream Stream)
    	throws IOException, ClassNotFoundException
    	{
		   	FileInputStream fis;
	        ObjectInputStream ois;

	        if ( Stream == null ) {
	    		throw new IOException( "No file name" );
	    	}
	        
	        fis = new FileInputStream("");
	        ois = new ObjectInputStream(fis);
	        	        
	        //int i = ois.readInt();
	        //String today = (String) ois.readObject();
	        
	        Stream.registerValidation(this, 0);
	        //Stream.defaultReadObject();
	        Stream.readObject();
	        
	        //Date date = (Date) ois.readObject();

	        ois.close();
	        fis.close();
    	}

	 private void writeObject(java.io.ObjectOutputStream stream)
     throws IOException{
		 
		 //ParameterImpl paramobject =  new model.ParameterImpl();
		 
		 FileOutputStream fos = new FileOutputStream("");
		 ObjectOutputStream oos = new ObjectOutputStream(fos);
		 
//		 ObjectOutput out = new ObjectOutputStream(new FileOutputStream("filename.ser"));
//		 out.writeObject(paramobject);
//		 out.close();
		 
		 //fos = new FileOutputStream("");
		 //oos = new ObjectOutputStream(fos);
		 
		 oos.defaultWriteObject();
		 oos.writeObject(PI);
		 oos.flush();
		 oos.close();
		 fos.close();
	 }
	
	
	@Override
	public void validateObject() throws InvalidObjectException {
		// TODO Auto-generated method stub
		String name1, name2;
		//if()
		
	}
	
	
}
